Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Reuse buffers in table iterations #2151

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

RReverser
Copy link
Member

@RReverser RReverser commented Jan 21, 2025

Description of Changes

This is one of the branches I had for a while, but never submitted as a PR as it wasn't a priority. Still might be nice to have eventually.

Benchmark comparisons:

Group Speedup Master Timing Reuse-C#-Buffers-Iter Timing
special/db_game/csharp/circles/load=10 1.50 1528.5±31.20ms 1015.9±13.92ms
special/db_game/csharp/circles/load=100 1.48 1522.5±21.20ms 1027.5±15.85ms
special/db_game/csharp/ia_loop/load=10 1.83 242.8±5.78ms 132.3±3.28ms
special/db_game/csharp/ia_loop/load=100 2.16 624.8±15.15ms 289.7±3.82ms
stdb_module/csharp/mem/filter/string/index/load=2048/count=256 1.09 865.0±29.83µs 790.6±29.09µs
stdb_module/csharp/mem/filter/u64/index/load=2048/count=256 1.16 525.3±9.86µs 452.1±6.28µs
stdb_module/csharp/mem/insert_bulk/u32_u64_u64/btree_each_column/load=2048/count=256 1.07 2.0±0.12ms 1900.5±104.00µs
stdb_module/csharp/mem/iterate/u32_u64_str/unique_0/count=256 1.06 790.5±46.63µs 746.3±13.33µs
stdb_module/csharp/mem/iterate/u32_u64_u64/unique_0/count=256 1.10 475.0±26.96µs 432.1±11.19µs

That is, the difference is fairly marginal in microbenchmarks, but really shines in integration ones which are arguably more representative of real-world scenarios.

In those, the speedup ranges from 1.5x to 2.1x.

API and ABI breaking changes

If this is an API or ABI breaking change, please apply the
corresponding GitHub label.

Expected complexity level and risk

1

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

This complexity rating applies not only to the complexity apparent in the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning ways.

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

  • Ran SDK tests for C#.
  • Ran dotnet test.

@bfops bfops added the release-any To be landed in any release window label Jan 21, 2025
@RReverser RReverser force-pushed the ingvar/reuse-csharp-buffers branch from 2f3da6e to 2f166df Compare January 23, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants